//工具函数JS

//获取中国时间yyyy-mm-dd hh:mm:ss
export let getChinatime = (str) => {
    let date = new Date(str);
    return date.getFullYear() + '-' + fillzero(date.getMonth() + 1) + '-' + fillzero(date.getDate()) + ' ' + fillzero(date.getHours()) + ':' + fillzero(date.getMinutes()) + ':' + fillzero(date.getSeconds());
}


//补0
export let fillzero = num => (num < 10 ? '0' + num : num)